package com.deyuanyun.pic.ctrl.controller.dto.validata;

import java.lang.reflect.Field;

import com.deyuanyun.pic.common.util.ObjectUtil;
import com.deyuanyun.pic.common.validator.vinterface.ValidateInterface;
import com.deyuanyun.pic.ctrl.enumeration.EqptTypeEnum;

/**
 * 验证设备自定义编号
 * 
 * @author ChenKui
 * @date 2016-02-22
 */
public class EQPTRecordValveroomRequestValidata implements ValidateInterface {

	@Override
	public <T, E,C> boolean apply(T t, E e,C c) {
	    
	    Field field = (Field)e;
	    try {
	        if(!field.get(c).equals(EqptTypeEnum.CPTESTSTATION.toString())){

	            if(ObjectUtil.isEmptyAll(t)){//不是阴保测试桩，就必须要有场站阀室
	                return false;
	            }
	        }
        } catch (Exception e2) {
            
        }
	    
		return true;
	}

	@Override
	public String getName() {
		return null;
	}

}
